﻿// ApiDescriptionSettingsAttribute.cs
// Copyright (c) 2022 chenchao
// Email:cc@on8.top

using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.AspNetCore.Mvc
{
    /// <summary>
    /// 接口描述设置 增强
    /// </summary>
    public class ApiExplorerSettingsOnWorkAttribute:ApiExplorerSettingsAttribute
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public ApiExplorerSettingsOnWorkAttribute() : base()
        {
            Order = 0;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="enabled">是否启用</param>
        public ApiExplorerSettingsOnWorkAttribute(bool enabled) : base()
        {
            IgnoreApi = !enabled;
            Order = 0;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="groups">分组列表</param>
        public ApiExplorerSettingsOnWorkAttribute(params string[] groups) : base()
        {
            Groups = groups;
            Order = 0;
        }

        /// <summary>
        /// 分组
        /// </summary>
        public string[] Groups { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        public string Tag { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Order { get; set; }
    }
}
